<%@ tag language="java" pageEncoding="UTF-8" trimDirectiveWhitespaces="true"%>
<%@ include file="/WEB-INF/views/utils/includes.jsp"%>
<%@ attribute name="title" required="false" rtexprvalue="true"%>

<c:if test="${ title == null }">
	<c:set var="title" value="Guias Transporte Online" />
</c:if>

<c:choose>
	<c:when test="${isAjax}">
		<jsp:doBody />
	</c:when>
	<c:otherwise>
		<!DOCTYPE html>
		<html dir="ltr" lang="pt-PT" class="chrome chrome30 desktop">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- Created by maumad 2013 -->
<meta charset="utf-8">
<title>${title}</title>

<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
<script src="/resources/js/jquery/jquery-1.7.2.js" type="text/javascript"></script>
<link rel="stylesheet" href="/resources/css/style.css">

<script type="text/javascript">
$(document).ready(
    function() {
        $("button[name=action]").click (
            function() {
                var obj = $(this);
                var method = obj.attr("action-method").toLowerCase();
                var url = obj.attr("action-url");
                
                if(method.toLowerCase() === 'get' || method.toLowerCase() === 'post') {
                    var form = obj.parents("form").first();
                    if(form != null) {
                        form.attr("action", url);
                        form.attr("method", method);
                        return true;
                    }
                }
                
            	if(url.indexOf('/') != 0) {
                	var action = window.location;
                	url = action + '/' + url;
            	}

                window.location = url;
                return false;
            }
        );
    }
);

</script>

<style type="text/css">
.form-input {
    display: block;
}

.menu-left {
    padding-top: 15px;
}

.menu-left span {
    display: block;
    padding-bottom: 5px;
}

.menu-top {
    padding-bottom: 50px;
}
.menu-top .left {
    float: left;
    padding-right: 10px;
}

.menu-top .right {
    float: right;
    padding-left: 10px;
}
</style>

</head>
<body>
	<table style="width: 1000px;">
		<tr>
			<td colspan="2" align="center" width="100%">
                 <gf:top-menu/>
			</td>
		</tr>
		<tr>
			<td style="padding-left: 5px; padding-right: 5px;" valign="top" width="20%">
			     <gf:left-menu/>
			</td>
			<td valign="top">
                <jsp:doBody/>
			</td>
		</tr>
	</table>
</body>
</html>
	</c:otherwise>
</c:choose>